<template>
  <div class="debtShopCode">
    <c-title :hide="false" text="店铺二维码"></c-title>
    <div class="img txt">
      <img :src="web_url" alt="" />
    </div>
    <span class="txt">扫描店铺二维码，跳转至债务人店铺</span>
  </div>
</template>
<script>
import { Toast } from "vant";
export default {
  data() {
    return {
      web_url: "",
    };
  },
  activated() {
    this.getData();
  },
  methods: {
    getData() {
      $http
        .get("plugin.debt-shop.frontend.debtor.getCode", {}, "加载中")
        .then((response) => {
          if (response.result === 1) {
            this.web_url = response.data.web_url;
          } else {
            Toast(response.msg);
          }
        })
        .catch((error) => {
          console.log(error);
        });
    },
  },
};
</script>
<style lang="scss" scoped>
.txt {
  margin-bottom: 1rem;
}
</style>
